<%@ Page Language="C#" MasterPageFile="~/Report.master" AutoEventWireup="true" CodeFile="VPPInvoice.aspx.cs" Inherits="Pages_Employee_ManageVPPPayment_VPPInvoice" Title="VPP Service Invoice" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2><asp:Label ID="Label1" runat="server" Text="VPP Service Invoice"></asp:Label></h2>
    <asp:HyperLink ID="lnkAddNewVPP" runat="server" NavigateUrl="~/Pages_Employee/ManageVPPPayment/AddVPPPayment.aspx"></asp:HyperLink>
    <br />
    <br />
    <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="DeliverableID"
        DataSourceID="SqlDataSource1" Height="50px" Width="447px" Font-Bold="False"
        style="margin:auto; text-align:left"  
         CellPadding="4" GridLines="Horizontal" BackColor="White" BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" >
        <FooterStyle BackColor="White" ForeColor="#333333" />
        <EditRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
        <RowStyle BackColor="White" ForeColor="#333333" />
        <PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
        <Fields>
            <asp:BoundField DataField="DeliverableID" HeaderText="Deliverable ID:" InsertVisible="False"
                ReadOnly="True" SortExpression="DeliverableID" />
            <asp:BoundField DataField="FullName" HeaderText="Customer:" SortExpression="FullName" />
            <asp:BoundField DataField="ContactNumber" HeaderText="Contact number:" ReadOnly="True"
                SortExpression="Contact Number" />
            <asp:TemplateField HeaderText="Amount to collect:" SortExpression="AmountToCollect">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("AmountToCollect") %>'></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("AmountToCollect") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# String.Format("{0:C}", Convert.ToDecimal(Eval("AmountToCollect"))) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Charge:" SortExpression="Charge">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Charge") %>'></asp:TextBox>
                </EditItemTemplate>
                <InsertItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Charge") %>'></asp:TextBox>
                </InsertItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# String.Format("{0:C}", Convert.ToDecimal(Eval("Charge"))) %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
        </Fields>
    </asp:DetailsView>
    <br />
    &nbsp;<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TarsConnection %>"
        ProviderName="System.Data.SqlClient" SelectCommand="SELECT Deliverables.DeliverableID, Customers.FullName, Customers.ContactNumber, VPPPayment.AmountToCollect, VPPPayment.Charge  FROM Deliverables INNER JOIN Customers ON Deliverables.CustomerID = Customers.CustomerID INNER JOIN VPPPayment ON Deliverables.DeliverableID = VPPPayment.DeliverableID WHERE (Deliverables.DeliverableID = @DeliverableID)">
        <SelectParameters>
            <asp:SessionParameter Name="DeliverableID" SessionField="VPPID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>

